def Holder(height):
    volume = []
    for i in range(0, len(height) - 1):
        for j in range(i + 1, len(height)):
            if height[j] >= height[i]:
                num = height[i] * (j - i)
                volume.append(num)
            else:
                num = height[j] * (j - i)
                volume.append(num)
    return max(volume)

str = input()
num = str.split()
height = list(map(int, num))
volume = Holder(height)
print(volume)